package com.yunchang.springboot.mapper.logisticsReconciliation;

import com.yunchang.springboot.config.BaseDao;
import com.yunchang.springboot.models.DO.logisticsReconciliation.WlFreightAllocation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WlFreightAllocationMapper extends BaseDao<WlFreightAllocation> {

    /**
     * 把不在当前发货状态下的发货批次号对应的所有数据在分摊运费表里删除
     * */
    int delShouldNotExistData();

    /**
     * 确认在马帮的调拨批次表中，该数据已经是已签收状态
     * */
    int confirmShippNo(@Param("shippNo") String shippNo);

    /**
     * 查找对应的shipNo和packNo的商品总数
     * */
    int getItemSumByShippNoPackNo(@Param("shippNo") String shippNo, @Param("packNo") String packNo);

    /**
     * 根据fbaStockId去查到platformSku
     * */
    String getPlatformSkuByFbaStockId(@Param("fbaStockId") String fbaStockId);

    /**
     * 从分摊运费表中获得在借贷关系中已经有FBA出库类型的借贷关系的shipmentId和sku对应且处理状态为新增的数据
     * */
    List<WlFreightAllocation> getNewDataByhandleStatus();

    /**
     * 批量更新数据的处理状态为2
     * @param wlFreightAllocationList
     * @return
     */
    int batchUpdateHandleStatus(@Param("wlFreightAllocationList") List<WlFreightAllocation> wlFreightAllocationList);

    /**
     * 更新数据的处理状态为2
     * @param wlFreightAllocation
     * @return
     */
    int updateHandleStatus(@Param("wlFreightAllocation")WlFreightAllocation wlFreightAllocation);
}